package com.spartez.farhorizons.client;

import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.MessageBox;
import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;

public class UploadRoster extends Panel {

	public UploadRoster() {
		setAutoHeight(true);
		setAutoWidth(true);
		Button button = new Button("System Info", new ButtonListenerAdapter() {

			public void onClick(final Button button, EventObject e) {  
				MessageBox.show(new MessageBoxConfig() {  
					{  
						setTitle("Systems info");  
						setMsg("Please paste the galaxy list here:");  
						setWidth(400);
						setDefaultTextHeight(600);
						setButtons(MessageBox.OKCANCEL);  
						setMultiline(true);  
						setCallback(new MessageBox.PromptCallback() {  
							public void execute(String btnID, String text) {  
								FarHorizons.dataService.setStarList(text);
							}  
						});  
						setAnimEl(button.getId());  
					}  
				});  
			}  
		});  
		add(button);
	}
}
